<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class M_assign extends Model {
	
	function M_assign()
	{
		parent::Model();
	}
	
	function index()
	{
		
	}

        function addassign($assignname,$assigninfo,$courseid,$classid,$createtime,$closetime)
	{
            $data['assignname'] = $assignname;
            $data['assigninfo'] = $assigninfo;
            $data['courseid']   = $courseid;
            $data['classid']    = $classid;
            $data['createtime'] = $createtime;
            $data['closetime']  = $closetime;
            //$data['assignfile'] = $assignfile;
            $this->db->insert('assign',$data);
            // $this->db->insert_id();    //返回自动生成的ID

	}
        

        function get_class()
        {
            return $this->db->get('class');
        }
        //根据学期及老师获取指定老师课程
        function get_class_by_year_and_teacher($tid,$yid)
        {
            $query=$this->db->query("select * from course where teacherid='$tid' and yearid='$yid'");
            return $query;
        }
}
?>